package main

import (
	_ "hello/routers"
	"github.com/astaxie/beego"
	_"hello/models"
	"strconv"
)

func main() {
	//添加视图函数
	beego.AddFuncMap("prePage",prePage)
	beego.Run()
}

//上一页视图函数
func prePage(i float64)(out string)  {
	num:=int(i)-1
	if num<=0 {
		num=1
	}
	out=strconv.Itoa(num)
	return
}